package team.seekers.catering.food.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import team.seekers.catering.common.result.R;
import team.seekers.catering.food.entity.vo.list.ComboCommentListVO;
import team.seekers.catering.food.service.ComboCommentService;

import java.util.List;

/**
 * 用户对套餐的评价
 * @author hbc
 * @since 2022-03-12
 */
@RestController
@RequestMapping("/combo-comment")
public class ComboCommentController {

    @Autowired
    private ComboCommentService comboCommentService;

    @GetMapping("/delete/{commentId}")
    public R delete(@PathVariable("commentId") String commentId){
        comboCommentService.removeById(commentId);
        return R.success();
    }

    @GetMapping("/list/{comboId}")
    public R list(@PathVariable("comboId") String comboId){
        List<ComboCommentListVO> list = comboCommentService.listByComboId(comboId);
        return R.success().data("rows",list);
    }

}

